package queues;

public class Test {

	public static void main(String[] args) {
		
		PostOfficeQueueSimulator postOffice = new PostOfficeQueueSimulator();
		
		Person a = new Person("Jim");
		postOffice.addPerson(a);
		Person b = new Person("Biff");
		postOffice.addPerson(b);
		Person c = new Person("Dan");
		
		postOffice.whoseAtFront();
		postOffice.serve();
		postOffice.whoseAtFront();
		System.out.println("There are " + postOffice.queueLength() + " in the queue.");
		
		postOffice.addPerson(c);
		Person d = new Person("Kate");
		postOffice.addPerson(d);
		Person e = new Person("Laura");
		postOffice.addPerson(e);
		Person f = new Person("Rick");
		postOffice.addPerson(f);
		
		System.out.println("There are " + postOffice.queueLength() + " in the queue.");
		postOffice.whoseAt(4);
		
		System.out.println("The queue has "+postOffice.queueLength()+" members.");
		for(int i=0; i < postOffice.queueLength(); ++i) {
			
			postOffice.serve();
		}
		
		System.out.println("There are "+postOffice.queueLength()+" in the queue.");
		System.out.println("Print the entire queue");
		postOffice.printQueue();
		System.out.println("There should be no output");
		
		Person g = new Person("Lisa");
		postOffice.addPerson(g);
		Person h = new Person("Maka");
		postOffice.addPerson(h);
		Person i = new Person("Joules");
		postOffice.addPerson(i);
		Person j = new Person("Mike");
		postOffice.addPerson(j);
		Person k = new Person("Will");
		postOffice.addPerson(k);
		Person l = new Person("Jimmy");
		postOffice.addPerson(l);
		
		postOffice.printQueue();
		
		for (int z=0; z < postOffice.queueLength(); ++z) {
			postOffice.serve();
		}
		
	}

}
